<template>
  <s-layout class="wallet-wrap" title="礼品册">
    <scroll-view
      :scroll-top="scrollTop"
      scroll-y="true"
      class="scroll-Y"
      @scrolltoupper="upper"
      @scrolltolower="lower"
      @scroll="scroll"
    >
      <view
        :class="status == 3 ? 'list1' : 'list'"
        v-for="(item, index) in list"
        :key="index"
        @click="togift(item)"
      >
        <view class="listview">
          <view>礼品册</view>
          <view style="font-size: 24rpx; margin-top: 10rpx">{{
            item.createTime
          }}</view>
          <view
            style="
              margin-top: 40rpx;
              display: flex;
              justify-content: space-between;
              align-items: center;
            "
          >
            <span style="font-size: 28rpx; font-weight: 700"
              >可选:{{ item.selectNumber }}件商品</span
            >
            <span>金额：{{ item.price }}元</span>
          </view>
        </view>
      </view>
    </scroll-view>
  </s-layout>
</template>
<script setup>
import { computed, watch, reactive, ref } from "vue";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import sheep from "@/sheep";
import dayjs from "dayjs";
import _ from "lodash";

const list = ref();

const moneylist = async () => {
  const res = await sheep.$api.order.getUserScoreBookRecord({});
  list.value = res;
  console.log(list.value, "我的值");
};
moneylist();

const togift = (item) => {
  console.log(item.bookId);
  uni.navigateTo({
    url: `/pages/user/wallet/gift?bookId=${item.bookId}&num=${item.selectNumber}&id=${item.id}`, // 假设你有一个礼物详情页面
  });
};
</script>
<style lang="scss" scoped>
.scroll-Y {
  height: 70vh;
  margin-top: 20rpx;
}

.list {
  width: 90%;
  margin: 20rpx auto;
  border-radius: 20rpx;
  background: linear-gradient(to right, #deb6fd, #8338ee);
  font-weight: 700;
  padding: 10rpx;
}
.listview {
  border-radius: 20rpx;
  height: 200rpx;
  background: linear-gradient(to right, #c181f0, #974eeb);
  box-sizing: border-box;
  padding: 20rpx;
  font-size: 34rpx;
  color: #8324b7;
}
</style>
